# -*- coding: utf-8 -*-
"""
Created on Wed Sep 26 20:13:45 2012

@author: Tomek
"""

import main

def writeNamespace(n):
    if n["name"]!="":
        print ("NAMESPACE")
        print (n["name"])
    for t in n["namespaces"]:
        writeNamespace(t)
    for t in n["classes"]:
        print ("CLASS")
        print (t["name"])
    for t in n["functions"]:
        if t["isOperator"]==False:
            print ("FUNCTION")
            print (t["name"])
    for t in n["enums"]:
        print ("ENUM")
        print (t["name"])
    if n["name"]!="":
        print ("ENDNS")
ns=main.loadNamespace("namespace")
writeNamespace(ns)